package com.example.mylibrary

import android.annotation.SuppressLint
import android.content.Context
import android.widget.Toast
import com.luck.picture.lib.utils.ToastUtils
//import com.luck.picture.lib.basic.PictureSelector
//import com.luck.picture.lib.config.SelectMimeType
//import com.luck.picture.lib.utils.ToastUtils
import io.reactivex.Observable
import io.reactivex.Scheduler
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers

class Books {
    @SuppressLint("CheckResult")
    fun init(context: Context) {
//        PictureSelector.create(context)
//            .openGallery(SelectMimeType.ofImage())
//            .forResult(100)
        Observable.create<String> {
            it.onNext("xx")
            it.onComplete()
        }.subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe {
//                Toast.makeText(context, it, Toast.LENGTH_SHORT).show()
                ToastUtils.showToast(context, it)
                println("====信息")
            }

    }
}